<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改收款账号')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-recipientInfo-edit" th:object="${tRecipientInfo}">
        <input name="id" th:field="*{id}" type="hidden">
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label is-required">用户id：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="userId" th:field="*{userId}" class="form-control" type="text" required>-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label is-required">是否平台收款账号：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="platformIs" th:field="*{platformIs}" class="form-control" type="text" required>-->
        <!--                </div>-->
        <!--            </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">通道类型：</label>
            <div class="col-sm-8">
                <select name="channelType" id="channelType"  class="form-control" th:with="type=${@dict.getType('channel_type')}" onchange="changeType()" disabled >
                    <option value="">所有</option>
                    <option th:each="dict : ${type}" th:field="*{channelType}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">渠道编码：</label>
            <div class="col-sm-8">
                <select name="channel" id="channel"  class="form-control" onchange="changeChannel()" disabled>
                    <option value="">所有</option>
                </select>
                <input id="channelVal" th:field="*{channelVal}" class="form-control" type="hidden">

                <!--                    <input name="channel" th:field="*{channel}" class="form-control" type="text" readonly>-->
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">通道账号：</label>
            <div class="col-sm-8">
                <input name="channelAccount" th:field="*{channelAccount}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">账号别名：</label>
            <div class="col-sm-8">
                <input name="realName" th:field="*{realName}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">分组标签：</label>
            <div class="col-sm-8">
                <input name="groupName" id="groupName" th:field="*{groupName}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">通道是否被禁用：</label>
            <div class="col-sm-8">
                <select name="channelDisabled"  class="form-control" th:with="type=${@dict.getType('yes_or_no')}">
                    <option value="">所有</option>
                    <option th:each="dict : ${type}" th:field="*{channelDisabled}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                </select>
            </div>
        </div>
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">银卡ID：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="cardId" th:field="*{cardId}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">银行卡号：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="cardNo" th:field="*{cardNo}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">支付宝cardid：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="alipayCardid" th:field="*{alipayCardid}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">实名：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="realName" th:field="*{realName}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">服务于指定用户：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="serveMerId" th:field="*{serveMerId}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">是否可用：</label>
            <div class="col-sm-8">
                <select name="available"  class="form-control" th:with="type=${@dict.getType('yes_or_no')}" >
                    <option value="">所有</option>
                    <option th:each="dict : ${type}" th:field="*{available}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">是否在线：</label>
            <div class="col-sm-8">
                <select name="online"  class="form-control" th:with="type=${@dict.getType('yes_or_no')}" disabled>
                    <option value="">所有</option>
                    <option th:each="dict : ${type}" th:field="*{online}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                </select>
            </div>
        </div>
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">上一次心跳时间：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <div class="input-group date">-->
        <!--                        <input name="lastHeartbeat" th:value="${#dates.format(tRecipientInfo.lastHeartbeat, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">-->
        <!--                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
        <!--                    </div>-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label is-required">是否需要客户端在线：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="needOnline" th:field="*{needOnline}" class="form-control" type="text" required>-->
        <!--                </div>-->
        <!--            </div>-->
        <div class="form-group" hidden="hidden" id="req_div">
            <label class="col-sm-3 control-label">请求参数：</label>
            <div class="col-sm-8">
                <textarea name="accountJson" class="form-control" rows="5">[[*{accountJson}]]</textarea>
            </div>
        </div>
        <div class="form-group" hidden="hidden" id="rs_div">
            <label class="col-sm-3 control-label">返回参数：</label>
            <div class="col-sm-8">
                <textarea name="returnJson" class="form-control"rows="5">[[*{returnJson}]]</textarea>
            </div>
        </div>


        <div class="form-group" id="login_url_div" hidden="hidden">
            <label class="col-sm-3 control-label">登录网址</label>
            <div class="col-sm-8">
                <input name="loginUrl" th:field="*{loginUrl}" class="form-control" type="text" >
            </div>
        </div>
        <div class="form-group" hidden="hidden" id="passwd_div">
            <label class="col-sm-3 control-label is-required">登录密码：</label>
            <div class="col-sm-8">
                <input name="passWord" th:field="*{passWord}" class="form-control" type="text" >
            </div>
        </div>
        <div class="form-group" hidden="hidden" id="ck_div">
            <label class="col-sm-3 control-label is-required">登录CK：</label>
            <div class="col-sm-8">
                <textarea name="loginCk" class="form-control" rows="3">[[*{loginCk}]]</textarea>

            </div>
        </div>

        <div class="form-group" hidden="hidden" id="lkl_shop_name_div">
            <label class="col-sm-3 control-label is-required">店铺名：</label>
            <div class="col-sm-8">
                <input name="lklShopname" th:field="*{lklShopname}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group" hidden="hidden" id="lkl_shop_no_div">
            <label class="col-sm-3 control-label is-required">商户号：</label>
            <div class="col-sm-8">
                <input name="lklShopno" th:field="*{lklShopno}"  class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group" hidden="hidden" id="lkl_shop_tremno_div">
            <label class="col-sm-3 control-label is-required">终端号：</label>
            <div class="col-sm-8">
                <input name="lklTermno" th:field="*{lklTermno}"  class="form-control" type="text" required>
            </div>
        </div>

        <div class="form-group" hidden="hidden">
            <label class="col-sm-3 control-label">收款二维码：</label>
            <div class="col-sm-8">
                <textarea name="receiptQrcode" class="form-control">[[*{receiptQrcode}]]</textarea>
            </div>
        </div>
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">手机序列号imei：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="imei" th:field="*{imei}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">设备信息：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="deviceInfo" th:field="*{deviceInfo}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">每日限额：</label>
            <div class="col-sm-8">
                <input name="limitDayMoney"  th:value="${tRecipientInfo.limitDayMoney}/100" class="form-control" type="text" required>
            </div>
        </div>
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label is-required">今天已收金额：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="todayMoney" th:field="*{todayMoney}" class="form-control" type="text" required>-->
        <!--                </div>-->
        <!--            </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">总限额：</label>
            <div class="col-sm-8">
                <input name="limitMaxMoney"  th:value="${tRecipientInfo.limitMaxMoney}/100" class="form-control" type="text" required>
            </div>
        </div>
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label is-required">总收取金额：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="totalMoney" th:field="*{totalMoney}" class="form-control" type="text" required>-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label is-required">是否店长模式：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="shopManager" th:field="*{shopManager}" class="form-control" type="text" required>-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">店长昵称：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="shopNickname" th:field="*{shopNickname}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">店员的账号：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="shopClerkAccount" th:field="*{shopClerkAccount}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">店员监控客户端是否在线：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="shopClerkOnline" th:field="*{shopClerkOnline}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">总的成功收款笔数：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="totalCount" th:field="*{totalCount}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label">总限制笔数：</label>
            <div class="col-sm-8">
                <input name="limitMaxCount" th:field="*{limitMaxCount}" class="form-control" type="text">
            </div>
        </div>
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">今日成功收款笔数：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="todayCount" th:field="*{todayCount}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label">今日限制笔数：</label>
            <div class="col-sm-8">
                <input name="limitDayCount" th:field="*{limitDayCount}"   class="form-control" type="text">
            </div>
        </div>
        <div class="form-group" hidden="hidden">
            <label class="col-sm-3 control-label">二维码金额：</label>
            <div class="col-sm-8">
                <input name="supportAmount"  th:value="${tRecipientInfo.supportAmount}/100" class="form-control" type="text">
            </div>
        </div>
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">PAYJS秘钥：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="payJsKey" th:field="*{payJsKey}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">最后产码时间：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <div class="input-group date">-->
        <!--                        <input name="lastCreateBillTime" th:value="${#dates.format(tRecipientInfo.lastCreateBillTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">-->
        <!--                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
        <!--                    </div>-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">身份证姓名：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="idCardName" th:field="*{idCardName}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">身份证号码：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="idCardNo" th:field="*{idCardNo}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">手机号码：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="phoneNo" th:field="*{phoneNo}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">京东买手号：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="jdBuyerId" th:field="*{jdBuyerId}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">-->
        <!--                <label class="col-sm-3 control-label">思语cookie：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <textarea name="cookie" class="form-control">[[*{cookie}]]</textarea>-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">今日临时总收款：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="todayTmpMoney" th:field="*{todayTmpMoney}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">京东电费缴费城市：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="jdDfCityId" th:field="*{jdDfCityId}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">电费缴费单位：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="jdDfUnitId" th:field="*{jdDfUnitId}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">电费余额：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="jdDfBlance" th:field="*{jdDfBlance}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label">单笔限额：</label>
            <div class="col-sm-8">
                <input name="onecePayLimit" th:value="${tRecipientInfo.onecePayLimit}/100" class="form-control" type="text">
            </div>
        </div>
        <div  hidden="hidden" id="area_div">
            <div class="form-group" >
                <label class="col-sm-3 control-label">归属省份：</label>
                <div class="col-sm-8">
                    <select name="province" id="province" class="form-control" onchange="changePro()"
                            th:with="type=${@proxyAreaCodeService.selectProvineCodeList()}">
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:text="${dict.province}"
                                th:field="*{province}" th:value="${dict.provinceCode}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group" >
                <label class="col-sm-3 control-label">归属城市：</label>
                <div class="col-sm-8">
                    <input id="cityVal" th:field="*{cityVal}" class="form-control" type="hidden">
                    <select name="city" id="city"  class="form-control">
                        <option value="">所有</option>
                    </select>
                </div>
            </div>
        </div>

        <div hidden="hidden" id="alipay_div">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">支付宝公钥：</label>
                <div class="col-sm-8">
                    <textarea name="aliPublicKey" class="form-control">[[*{aliPublicKey}]]</textarea>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label is-required">应用私钥：</label>
                <div class="col-sm-8">
                    <textarea name="aliPrivateKey" class="form-control">[[*{aliPrivateKey}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required"></label>
                <div class="col-sm-8">
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i><a href="https://opendocs.alipay.com/support/01raut?pathHash=2c7adc9e" target="_blank">获取支付宝公钥和应用私钥</a> </span>
                </div>
            </div>
        </div>

        <div hidden="hidden" id="gamepay_div">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">网关地址：</label>
                <div class="col-sm-8">
                    <input name="gameUrl"  th:value="${tRecipientInfo.gameUrl}"  class="form-control"></input>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label is-required">商户号：</label>
                <div class="col-sm-8">
                    <input name="gamePid" th:value="${tRecipientInfo.gamePid}"   class="form-control"></input>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">密钥：</label>
                <div class="col-sm-8">
                    <input name="gameKey"  th:value="${tRecipientInfo.gameKey}" class="form-control"></input>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">支付类型：</label>
                <div class="col-sm-8">
                    <input name="gamepayType" th:value="${tRecipientInfo.gamepayType}"  class="form-control"></input>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">支付方式：</label>
                <div class="col-sm-8">
                    <input name="gamepayMethod"  th:value="${tRecipientInfo.gamepayMethod}"  class="form-control"></input>
                </div>
            </div>
        </div>
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">归属省份：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="province" th:field="*{province}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">归属城市：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="city" th:field="*{city}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="bankName" th:field="*{bankName}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">-->
        <!--                <label class="col-sm-3 control-label">：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <textarea name="disabledInfo" class="form-control">[[*{disabledInfo}]]</textarea>-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="createUser" th:field="*{createUser}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="updateUser" th:field="*{updateUser}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="weiShu" th:field="*{weiShu}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-typeahead-js" />
<script th:inline="javascript">
    var prefix = ctx + "business/recipientInfo";
    $("#form-recipientInfo-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/copy", $('#form-recipientInfo-edit').serialize());
        }
    }
    $('#channelType').trigger('change');

    // var event = document.createEvent('HTMLEvents');
    // event.initEvent('change', true, true);
    // selectElement.dispatchEvent(event);
    // selectElement.addEventListener("change", function(event) {
    //     var selectedOption = event.target.value;
    //     // 执行相应的操作，例如更新页面内容或发送请求
    //     console.log("选择了选项：" + selectedOption);
    //     changeType(selectedOption);
    // });
    $.get(prefix + "/getGroupName", function(data){
        $("#groupName").typeahead({
            source: data.value
        });
    },'json');
    function changeType(){
        if($('#channelType').val()==""){
            return;
        }
        requrl=ctx+"business/channel/getChannel/"+$('#channelType').val();
        var config = {
            url:requrl ,
            type: "post",
            dataType: "json",
            beforeSend: function () {
                $.modal.loading("正在处理中，请稍后...");
                // $.modal.disable();
            },
            success: function(result) {
                $.modal.closeLoading();
                if (result.code == web_status.SUCCESS) {
                    $("#channel").html("<option value=\"\">所有</option>");
                    $.each(result.data, function(key, val) {
                        if ($("#channelVal").val()==val.channel) {
                            $("#channel").append("<option value='" + val.channel +  "' selected>" + val.channelDesc + "</option>");
                        }else{
                            $("#channel").append("<option value='" + val.channel +  "'>" + val.channelDesc + "</option>");
                        }
                    });
                    $('#channel').trigger('change');
                }else{
                    $.modal.alertError(result.msg);
                }
            }
        };
        $.ajax(config)
    }
    $('#province').trigger('change');

    function changePro() {
        if($("#province").val()==""){
            return;
        }
        requrl=ctx+"business/ProxyAreaCode/getCityByCode/"+$("#province").val();
        var config = {
            url:requrl ,
            type: "post",
            dataType: "json",
            beforeSend: function () {
                $.modal.loading("正在处理中，请稍后...");
                // $.modal.disable();
            },
            success: function(result) {
                $.modal.closeLoading();
                if (result.code == web_status.SUCCESS) {
                    $("#city").html("<option value=\"\">所有</option>");
                    $.each(result.data, function(key, val) {
                        if ($("#cityVal").val()==val.cityCode) {
                            $("#city").append("<option value='" + val.cityCode +  "' selected>" + val.city + "</option>");
                        }else{
                            $("#city").append("<option value='" + val.cityCode +  "'>" + val.city + "</option>");
                        }
                    });
                }else{
                    $.modal.alertError(result.msg);
                }
            }
        };
        $.ajax(config)
    }


    function changeChannel() {
        var channel = $("#channel").val();
        if(channel==""){
            return;
        }
        if(channel.startsWith("isv_alipay")){
            $("#alipay_isv_div").show();
        }else{
            $("#alipay_isv_div").hide();
        }
        if(channel.startsWith("gf_alipay_")){
            $("#alipay_div").show();
        }else{
            $("#alipay_div").hide();
        }
        if(channel.startsWith("gf_cert_alipay_")){
            $("#alipay_cert_div").show();
        }else{
            $("#alipay_cert_div").hide();
        }
        if(channel.startsWith("lakala_pay")){
            $("#lkl_shop_no_div").show();
            $("#lkl_shop_name_div").show();
            $("#lkl_shop_tremno_div").show();

        }else{
            $("#lkl_shop_no_div").hide();
            $("#lkl_shop_name_div").hide();
            $("#lkl_shop_tremno_div").hide();
        }
        if(channel.startsWith("game_pay_")){
            $("#gamepay_div").show();
        }else{
            $("#gamepay_div").hide();
        }
        requrl=ctx+"business/channel/getChannelByCode/"+$("#channel").val();
        var config = {
            url:requrl ,
            type: "post",
            dataType: "json",
            beforeSend: function () {
                $.modal.loading("正在处理中，请稍后...");
                // $.modal.disable();
            },
            success: function(result) {
                $.modal.closeLoading();
                if (result.code == web_status.SUCCESS) {
                    var obj = result.data;
                    if(obj.reqType==0){
                        $("#req_div").show();
                        $("#rs_div").show();
                    }else {
                        $("#req_div").hide();
                        $("#rs_div").hide();
                        if (obj.needOnLine == 1 && obj.loginType == 'password') {
                            $("#login_url_div").show();
                            $("#passwd_div").show();
                        } else if (obj.needOnLine == 1 && obj.loginType == 'ck') {
                            $("#login_url_div").hide();
                            $("#passwd_div").hide();
                            $("#ck_div").show();
                        } else {
                            $("#login_url_div").hide();
                            $("#passwd_div").hide();
                            $("#ck_div").hide();
                        }
                        if (obj.isArea == 1) {
                            $("#area_div").show();
                        } else {
                            $("#area_div").hide();
                        }
                    }
                }else{
                    $.modal.alertError(result.msg);
                }
            }
        };
        $.ajax(config)
    }

    // $("input[name='lastHeartbeat']").datetimepicker({
    //     format: "yyyy-mm-dd",
    //     minView: "month",
    //     autoclose: true
    // });
    //
    // $("input[name='lastCreateBillTime']").datetimepicker({
    //     format: "yyyy-mm-dd",
    //     minView: "month",
    //     autoclose: true
    // });
</script>
</body>
</html>